Repository navigation
Make reverse-engineered SQL test delete steps fail when nothing is deleted. #10901 - #10902
Conversation
…leted. pgadmin-org#10901 The resql runner reset the schema id to the default test schema for any create scenario without a schema, so a delete after creating a child object (such as a foreign key) used the wrong schema. It also only checked for an HTTP 200 from delete, which pgAdmin returns with success set to 0 when the object is not found. Keep the schema id from the last create that named one, and fail a delete step whose response has success set to 0. Fix the test data this exposed: a duplicated foreign key drop, tables dropped in an order the runner could not target, an index test that dropped its table before its last step, and view tests that dropped their table using the view's id. Closes pgadmin-org#10901
|
No actionable comments were generated in the recent review. WalkthroughThe ReSQL test runner retains the selected schema across create scenarios without a schema field and checks delete response success. Test fixtures enable object ID storage and update table and foreign-key cleanup steps. ChangesReSQL test scenarios
Estimated code review effort: 2 (Simple) | ~12 minutes Change: Other · Severity of issue fixed: Low Possibly related PRs
Merge Risk:
|
Summary
web/regression/re_sql/tests/test_resql.py) now keeps the schema id from the last create scenario that named a schema, rather than resetting it to the default test schema for child objects such as constraints, and fails a delete step whose response hassuccessset to 0 (pgAdmin returns HTTP 200 with "Object not found").default,18_plus): removed a duplicated "Drop Foreign Key" step, and dropped the second table by id and the first by name throughNODE-table.delete, since adelete_idtable step always targets the last stored table.default,15_plus): "Drop Table" ran before the last index create and delete; moved it to the end. It only appeared to work before because it was silently hitting the wrong schema.pgandppastests.json): "Drop Table for view" used the view's id; the table create now stores its id.Test plan
runtests.py --pkg resqlon PostgreSQL 18 (local), 14, 15, 16 and 17 (Docker): all pass, and the changed drop steps run and report ok on each.ppas) files were changed in the same way but not run locally.Closes #10901
Summary by CodeRabbit